package com.hutianao.gqgl.information.harbor.service.impl;


import com.hutianao.gqgl.information.harbor.entity.SearchHarborEntity;
import com.hutianao.gqgl.information.harbor.respository.HarborDao;
import com.hutianao.gqgl.information.harbor.service.HarborService;
import com.hutianao.gqgl.mybatis.entity.CoalHarborEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PadingRstType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class HarborServiceImpl implements HarborService {
    @Resource
    private HarborDao coalHarborDao;

    @Override
    public PadingRstType<CoalHarborEntity> queryCoalHarborInfoListByPage(SearchHarborEntity search, PaddingEntity padding) {
        padding.deal(CoalHarborEntity.class);
        PadingRstType<CoalHarborEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(padding.getPage());
        List<CoalHarborEntity> list = coalHarborDao.queryCoalHarborInfoListByPage(search,padding);
        padingRstType.setRawRecords(list);
        Integer total = coalHarborDao.queryCoalHarborInfoTotal(search);
        padingRstType.setTotal(total);
        padingRstType.putItems();

        return padingRstType;
    }
}